package com.meida.module.bus.provider.handler;

import com.meida.common.base.entity.EntityMap;
import com.meida.common.mybatis.interceptor.PageInterceptor;
import com.meida.common.mybatis.model.PageParams;
import com.meida.common.mybatis.query.CriteriaQuery;
import com.meida.module.bus.client.entity.BusSubject;
import com.meida.module.bus.client.entity.BusTutorType;
import org.springframework.stereotype.Component;

/**
 * 后台辅导类型列表
 */
@Component
public class BusTutorTypePageListHandler implements PageInterceptor<BusTutorType> {

    @Override
    public void prepare(CriteriaQuery<BusTutorType> cq, PageParams pageParams, EntityMap params) {
        cq.clear();
        cq.select(BusTutorType.class, "tutorTypeId", "tutorTypeName", "tutorPrice", "priceUnit", "chargeType", "tutorState", "updateTime", "createTime");
        cq.select(BusSubject.class, "subjectTitle");
        cq.like(BusTutorType.class, "tutorTypeName");
        cq.eq(BusSubject.class, "subjectId");
        cq.createJoin(BusSubject.class).setMainField("subjectId").setJoinField("subjectId");
    }


}
